-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add history and shareable URLs support to Instant Results #2604
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JakePT do you mind checking the |
@felipeelia I've pushed fixes for the JSDoc warnings. |
@JakePT, I could not test this one. Some problems I found:
|
I have also pushed fixes for the various linting errors that were occurring with this PR. So everything should be good to test again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
This pull requests adds the following to Instant Results:
Resolves #2506
Alternate Designs
This PR implements the searchable URLs by defining custom URL parameters only used by Instant Results. These are:
Taxonomy filters use the argument
ep-tax_${taxonomy}
, wheretaxonomy
is the taxonomy used for the filter.This approach means that default WordPress search URLs, like
?s=shirt&post_type=product
will not trigger the Instant Results modal to appear. An approach that supports launching Instant Results from default WordPress search URLs, with support for filters from the Facet widget or WooCommerce, might be achievable, but it would require more complicated code to map the default supported parameters to ElasticPress API parameters.The upside of this approach is that it keeps all the behaviour contained to Instant Results, and keeps the code simpler, but the downside is that any existing shared/bookmarked search URLs will not take advantage of Instant Results, and it means that any shared or bookmarked Instant Results URLs will cease to work if Instant Results is deactivated.
All that being said, the existence of this approach does not necessarily preclude adding support for other parameters in future, possibly as an option.
Possible Drawbacks
There's a few things that are currently limited about the approach:
Verification Process
With the plugin installed and Instant Results activated:
?ep-highlight=mark&ep-offset=0&ep-orderby=relevance&ep-order=desc&ep-per_page=6&ep-post_type=&ep-search=block&ep-relation=and
.Checklist:
Changelog Entry
Credits
Props @JakePT